import request from '@/utils/request'

export function getListPage(params) {
  return request({
    url: '/operate/firstpagePicss/list',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'pageNum': params.pageNum,
      'pageSize': params.pageSize
    },
    method: 'get',
    params:params
  })
}
export function delPicture(rowId) {
  return request({
      url: '/operate/firstpagePicss/'+rowId,
      headers: {
          'Content-Type': 'application/json;charset=UTF-8'
      },
      method: 'delete',
  })
}
/**
 * 上传图片
 * @param {Object} data
 */
export function addImg(data) {
  return request({
    url: '/ids/pub/file/uploadFile',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'post',
    data
  })
}
export function getAllProInfo() {
  return request({
    url: '/operate/proInfos/Commodity',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
  })
}

export function updatePicture(data) {
  return request({
    url: '/operate/firstpagePicss/update',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'put',
    data
  })
}

export function addPicture(data) {
  return request({
    url: '/operate/firstpagePicss/save',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    method: 'post',
    data
  })
}